package com.lxw.manager.cms.controller;

import com.lxw.framework.web.BaseController;
import com.lxw.manager.cms.service.CmsPageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class CmsPagePreviewController extends BaseController {

    @Autowired
    private CmsPageService cmsPageService;
    //接收到页面id
     @RequestMapping(value="/cms/preview/{pageId}",method= RequestMethod.GET)
    public void preview(@PathVariable("pageId") String pageId) throws Exception{
        String s = cmsPageService.gericHtml(pageId);
        response.setContentType("text/html;charset=utf-8");
        response.getWriter().write(s);
    }
}
